package com.base.engine.gui;

import org.lwjgl.opengl.Display;

import com.base.engine.MADEngine;
import com.base.engine.game.MADGame;
import com.base.engine.graphics.MADBasicGL;

import static org.lwjgl.opengl.GL11.*; 

public final class MADUserInterface{

	private static MADDebuggingScreen debuggingScreen ; 
	private static MADMenuScreen menuScreen ; 
	
	public static void create(MADGame g){
		debuggingScreen = new MADDebuggingScreen(g, 0, 0, MADDebuggingScreen.WIDTH, MADDebuggingScreen.HEIGHT); 
		menuScreen = new MADMenuScreen(g, (MADEngine.WIDTH-MADMenuScreen.WIDTH)/2, (MADEngine.HEIGHT-MADMenuScreen.HEIGHT)/2,
										MADMenuScreen.WIDTH, MADMenuScreen.HEIGHT); 
		menuScreen.activate();
	}
	
	public static void update(){
		debuggingScreen.update(); 
	}
	
	public static void render() {
		MADBasicGL.switch2D(0, 	0, Display.getWidth(), Display.getHeight());
			glPushMatrix();
				debuggingScreen.render();
				menuScreen.render(); 
				glPopMatrix();
		MADBasicGL.switch3D();
	}

	public static MADDebuggingScreen getDebuggingScreen() {
		return debuggingScreen;
	}

	public static void setDebuggingScreen(MADDebuggingScreen debuggingScreen) {
		MADUserInterface.debuggingScreen = debuggingScreen;
	}

	public static MADMenuScreen getMenuScreen() {
		return menuScreen;
	}

	public static void setMenuScreen(MADMenuScreen menuScreen) {
		MADUserInterface.menuScreen = menuScreen;
	}
	
	
	
	
}
